package com.kele.client;

import com.kele.common.model.response.PageResult;
import com.kele.model.goods.Goods;
import com.kele.model.goods.dto.GoodsDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * 如果使用FeignClient调用相同微服务，
 * 但是使用了超过一个接口，需要配置contextId，只要不相同就行
 */
@FeignClient(value = "kele-goods",contextId="goods")
public interface GoodsFeignClient {

    @GetMapping("goods/selectById/{id}")
    public GoodsDTO selectById(@PathVariable Long id);

    @PostMapping("goods/findPage/{pageNo}/{pageSize}")
    public PageResult<Goods> findPage(@PathVariable Integer pageNo,
                                      @PathVariable Integer pageSize,
                                      @RequestBody Map searchMap);


}
